<?php

use Illuminate\Database\Seeder;
use App\Model\Admin;
class AdminSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        # 先进行清空管理员表，再进行添加
        Admin::truncate();
        # 使用$factory生成模拟数据
        factory(Admin::class,10)->create();
        # 修改一条数据
        Admin::where("id",8)->update(["usernaem"=>"admin","truename"=>"小杨"]);
    }
}
